<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增商家商品')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-product-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">类目名称：</label>
                <div class="col-sm-8">
                    <select class="form-control" name="categoryNumber">
                        <option value="" data-select2-id="3">--请选择所属类目--</option>
                        <option th:each="OptShopProductinfo:${OptShopProductinfo}"
                                th:value="${OptShopProductinfo.categoryNumber}"
                                th:text="${OptShopProductinfo.categoryName}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">商品名称：</label>
                <div class="col-sm-8">
                    <input name="productName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">单价：</label>
                <div class="col-sm-8">
                    <input name="productPrice" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">库存：</label>
                <div class="col-sm-8">
                    <input name="productStock" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <input name="productDescription" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">商品图片：</label>
                <div class="col-sm-8">
                    <textarea name="productIcon" class="form-control"></textarea>
                </div>
            </div>
        </form>
</div>
        <th:block th:include="include :: footer"/>
        <script th:inline="javascript">
            var prefix = ctx + "operator/product"
            $("#form-product-add").validate({
                focusCleanup: true
            });

            function submitHandler() {
                if ($.validate.form()) {
                    var str  = $('#form-product-add').serialize();
                    $.operate.save(prefix + "/add", $('#form-product-add').serialize());
                }
            }
        </script>
</body>
</html>